import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '职工号',
    align:"center",
    dataIndex: 'no'
   },
   {
    title: '姓名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '电话',
    align:"center",
    dataIndex: 'tel'
   },
   {
    title: '年龄',
    align:"center",
    dataIndex: 'age'
   },
   {
    title: '工龄',
    align:"center",
    dataIndex: 'seniority'
   },
   {
    title: '是否满足申请条件',
    align:"center",
    dataIndex: 'satisfyRoomCondition_dictText'
   },
   {
    title: '最新得分',
    align:"center",
    dataIndex: 'latestScore'
   },
   {
    title: '身份证号',
    align:"center",
    dataIndex: 'idcard'
   },
   {
    title: '身份证人像图',
    align:"center",
    dataIndex: 'idcardFront',
    customRender:render.renderAvatar,
   },
   {
    title: '身份证国徽图',
    align:"center",
    dataIndex: 'idcardBack',
    customRender:render.renderAvatar,
   },
   {
    title: '性别',
    align:"center",
    dataIndex: 'sex_dictText'
   },
   {
    title: '集团',
    align:"center",
    dataIndex: 'gro'
   },
   {
    title: '站段',
    align:"center",
    dataIndex: 'station'
   },
   {
    title: '车间',
    align:"center",
    dataIndex: 'shop'
   },
   {
    title: '户口所在地',
    align:"center",
    dataIndex: 'household'
   },
   {
    title: '家庭地址',
    align:"center",
    dataIndex: 'address'
   },
   {
    title: '是否结婚',
    align:"center",
    dataIndex: 'ismarried_dictText'
   },
   {
    title: '配偶姓名',
    align:"center",
    dataIndex: 'sname'
   },
   {
    title: '配偶身份证',
    align:"center",
    dataIndex: 'sidcard'
   },
   {
    title: '配偶工作单位',
    align:"center",
    dataIndex: 'sworkCompany'
   },
   {
    title: '配偶工作地',
    align:"center",
    dataIndex: 'swordPlace'
   },
   {
    title: '配偶户口所在地',
    align:"center",
    dataIndex: 'shousehold'
   },
   {
    title: '岗位',
    align:"center",
    dataIndex: 'jobName'
   },
   {
    title: '职称',
    align:"center",
    dataIndex: 'jobTitle'
   },
   {
    title: '职位级别',
    align:"center",
    dataIndex: 'jobLevel'
   },
   {
    title: '账号状态',
    align:"center",
    dataIndex: 'state_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '职工号',
    field: 'no',
    component: 'Input',
  },
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入姓名!'},
          ];
     },
  },
  {
    label: '电话',
    field: 'tel',
    component: 'Input',
  },
  {
    label: '年龄',
    field: 'age',
    component: 'InputNumber',
  },
  {
    label: '工龄',
    field: 'seniority',
    component: 'InputNumber',
  },
  {
    label: '是否满足申请条件',
    field: 'satisfyRoomCondition',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     }
  },
  {
    label: '最新得分',
    field: 'latestScore',
    component: 'InputNumber',
  },
  {
    label: '身份证号',
    field: 'idcard',
    component: 'Input',
  },
  {
    label: '身份证人像图',
    field: 'idcardFront',
     component: 'JImageUpload',
     componentProps:{
      }
  },
  {
    label: '身份证国徽图',
    field: 'idcardBack',
     component: 'JImageUpload',
     componentProps:{
      }
  },
  {
    label: '性别',
    field: 'sex',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sex"
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入性别!'},
          ];
     },
  },
  {
    label: '集团',
    field: 'gro',
    component: 'Input',
  },
  {
    label: '站段',
    field: 'station',
    component: 'Input',
  },
  {
    label: '车间',
    field: 'shop',
    component: 'Input',
  },
  {
    label: '户口所在地',
    field: 'household',
    component: 'Input',
  },
  {
    label: '家庭地址',
    field: 'address',
    component: 'Input',
  },
  {
    label: '是否结婚',
    field: 'ismarried',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"yn"
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否结婚!'},
          ];
     },
  },
  {
    label: '配偶姓名',
    field: 'sname',
    component: 'Input',
  },
  {
    label: '配偶身份证',
    field: 'sidcard',
    component: 'Input',
  },
  {
    label: '配偶工作单位',
    field: 'sworkCompany',
    component: 'Input',
  },
  {
    label: '配偶工作地',
    field: 'swordPlace',
    component: 'Input',
  },
  {
    label: '配偶户口所在地',
    field: 'shousehold',
    component: 'Input',
  },
  {
    label: '岗位',
    field: 'jobName',
    component: 'Input',
  },
  {
    label: '职称',
    field: 'jobTitle',
    component: 'Input',
  },
  {
    label: '职位级别',
    field: 'jobLevel',
    component: 'Input',
  },
  {
    label: '账号状态',
    field: 'state',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"user_status"
     }
  },
];
